<template>
  <div class="wrapper" @click="close">
    <view class="num">{{ current }} / {{ list.length }}</view>
    <div class="content">
      <movable-area>
        <movable-view
          direction="all"
          :scale="true"
          scale-min="1"
          scale-max="4"
          :scale-value="scale"
        >
          <Banner
            :autoplay="false"
            :List="list"
            @currents="currents"
            :heights="670"
            :height="670"
          ></Banner>
        </movable-view>
      </movable-area>
    </div>
  </div>
</template>

<script>
import Banner from '@/components/banner'
export default {
  components: {
    Banner
  },
  props: {
    list: {
      type: Array
    }
  },
  data() {
    return {
      current: 1
    }
  },
  methods: {
    close() {
      this.$emit('close')
    },
    currents(e) {
      this.current = e + 1
    }
  }
}
</script>

<style lang="less" scoped>
.wrapper {
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background: #000;
  position: absolute;
  z-index: 99999;
  .num {
    color: #fff;
    display: flex;
    justify-content: center;
  }

  .content {
    position: absolute;
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    movable-area {
      width: 750rpx;
      height: 600rpx;
      movable-view {
        width: 100%;
        height: 100%;
      }
    }
  }
}
</style>
